Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-ts latest

Selection.[Symbol.iterator]

Iterate in tmux's own order.

Source and package
Qualified name
Selection.[Symbol.iterator]
Module
selection
Declared in
Selection
Package
libtmux
Source
packages/libtmux/src/selection.ts
[Symbol.iterator](): IterableIterator<Model>

Description#

Each call returns a fresh iterator, so a selection can be walked more than once: spread it and then loop it, and the second pass is not empty. This is what for...of, spread and destructuring all go through.

Examples#

for (const window of snapshot.windows) window.name;
[...snapshot.windows].length === snapshot.windows.length;
Type parameters
Esc

Type to search.

Reference previewOpen reference